<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/11 0011
 * Time: 下午 8:50
 */
include "status.php";
include "config.php";
if($_SERVER["REQUEST_METHOD"]!="POST"){
    print_r(json_encode(status::$r_0));
    return ;
}
if (isset($_REQUEST["utel"])&&isset($_REQUEST["upwd"])){

    $UTEL=$_REQUEST["utel"];
    $UPWD=$_REQUEST["upwd"];


    $sql="insert into userinfo (u_tel,u_pwd)values (?,?);";
    $stmt=$conn->prepare($sql);
    $stmt->bind_param("ss",$UTEL,$UPWD);
    $stmt->execute();
    if ($stmt->affected_rows>=1){
        print_r(json_encode(status::$r_success));
    }else{
        print_r(json_encode(status::$r_error));
    }

    $stmt->close();
    $conn->close();
}else{
    print_r(json_encode(status::$r_1));
}